#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1 << 20 | 5;
const int mod = 998244353;
int n;
char ss[maxn];
int main(){
    freopen("song.in", "r", stdin);
    freopen("song.out", "w", stdout);
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> (ss + 1); n = strlen(ss + 1);
    if(n & 1){
	cout << (n + 1) / 2 << endl; return 0;
    }
    if(ss[1] == 'A'){
	cout << n / 2 << endl; return 0;
    }
    cout << n / 2 + 1 << endl;
    return 0;
}
